package com.e7.action;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.e7.common.E7Action;
import com.e7.model.User;
import com.e7.service.ManorService;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;

@Component("seigniorAction")
public class SeigniorAction extends E7Action {
	private static final long serialVersionUID = -4704484711918393189L;

	private ManorService manorService;

	// client set
	private Integer id;
	private String title;
	private String theme;

	// return

	public String applySeignior() {
		Map<String, Object> session = ActionContext.getContext().getSession();
		User user = (User) session.get("user");
		this.manorService.addApplier(user, this.id, this.title, this.theme);
		// TODO
		return Action.SUCCESS;
	}

	@Resource
	public void setManorService(ManorService manorService) {
		this.manorService = manorService;
	}
}
